<?php require_once ADMINVIEWPATH.'admin_header.php'; ?>
<?php require_once ADMINVIEWPATH.'admin_menu.php'; ?>
<!-- Page Content -->
            <div class="page-content">
                <!-- Page Breadcrumb -->
                <div class="page-breadcrumbs">
                    <ul class="breadcrumb">
                        <li>
                            <i class="fa fa-home"></i>
                            <a href="/luckydog/index">首页</a>
                        </li>
                        <li>
                            <a href="#">意见反馈管理</a>
                        </li>
                        <li class="active">
                            意见反馈温馨提示语
                        </li>
                    </ul>
                </div>
               
                <!-- Page Body -->
                <div class="page-body">
                    <div class="row">
                        <div class="col-xs-12 col-md-12">
                            <div class="tab-content tabs-flat no-padding">
                                <div id="visits" class="tab-pane active animated fadeInUp">
                                    <div class="row">
                                        <div class="col-lg-12 chart-container">
                                            <div id="dashboard-chart-visits" class="chart chart-lg no-margin">
                                                <div class="widget-body">
                                                        <table class="table table-striped table-bordered table-hover" id="simpledatatable">
                                                            <thead>
                                                                <tr>
                                                                    <th>名称</th>
                                                                    <th>内容</th>
                                                                    <th>操作</th>
                                                                </tr>
                                                            </thead>
                                                            <tbody>
                                                             <?php
                                                              if (!empty($contact))
                                                              {
                                                                foreach ($contact AS $row)
                                                                {
                                                              ?>
                                                                <tr class="gradeX">
                                                                    <td class="center">
                                                                            <span><?=$row['name']?></span>
                                                                    </td>
                                                                    <td class="center">
                                                                            <span><?=$row['content']?></span>
                                                                    </td>
                                                                    <td  class="center " data_id="<?=$row['id']?>">
                                                                        <a href='javascript:void(0);'  class="editCat">修改</a>
                                                                    </td>
                                                                </tr>
                                                            <?php
                                                                }
                                                              }
                                                              ?>
                                                            </tbody>
                                                        </table>
                                                    </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <!-- /Page Body -->
        </div>
        <!-- /Page Content -->
<script src="<?php echo STATICURL; ?>js/jquery-2.0.3.min.js"></script>
<script src="<?php echo STATICURL; ?>layer/layer.js"></script>
<?php require_once ADMINVIEWPATH.'admin_footer.php'; ?>
<script>
    $(document).ready(function(){
        $('.addCat').on('click', function(){
            //iframe窗
            layer.open({
                type: 2,
                title: '添加',
                shade: [0.5, '#000'],
                shadeClose: false,
                maxmin: true, //开启最大化最小化按钮
                area: ['550px', '240px'],
                content: '/luckydog/feedback/contactedit'
            });
        });
        $('.editCat').on('click', function(){
            //iframe窗
            var id = $(this).parent().attr("data_id");
            layer.open({
                type: 2,
                title: '修改',
                shade: [0.5, '#000'],
                shadeClose: false,
                maxmin: true, //开启最大化最小化按钮
                area: ['550px', '240px'],
                content: '/luckydog/newscategory/edit?id='+id
            });
        });
        $(".js_del").click(function(){
            var cat_id = $(this).parent().attr("data_id");
            //判断是否有子分类
                if(confirm("确定删除当前分类吗?")){
                    $.post("/luckydog/newscategory/do_del", {cat_id:cat_id}, function(data) {               
                        if (data) {
                            lay.msg("成功");                  
                            window.location.href = "/luckydog/newscategory";
                        }else{
                            lay.msg("失败");
                        }
                    }, "json");
                }            
            
        });     
    });
</script>



